func distributeCandies(ans int, num_people int) []int {
    nums:=make([]int,num_people)
    for i:=0;i<num_people;i++{
        nums[i]=0
    }
    i:=1
    j:=0
    for ans>0{
        if ans>=i{
            nums[j%num_people]=nums[j%num_people]+i
        }else{
            i=ans
            nums[j%num_people]=nums[j%num_people]+i
        }
        ans=ans-i
        i=i+1
        j=j+1
    }
    return nums
}